﻿'------------------------------
' Hien thi 6 tin moi nhat cua Cate
'------------------------------
Imports System
Imports System.Web
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports DotNetNuke
Namespace NVPortal.Modules.NVNews

    Public MustInherit Class newsnotes
        Inherits Entities.Modules.PortalModuleBase
        Private _catId As Integer = 0

#Region "Controls"
#End Region

#Region "Event Handlers"
        Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            Try
                If Not IsPostBack Then
                    Dim arrNews2 As New ArrayList
                    Dim ctlNews2 As New NV_NewsController
                    Dim i As Integer
                    If IsNumeric(Settings("NVNewsDisplayNumberSetting")) Then
                        i = Settings("NVNewsDisplayNumberSetting")
                    Else
                        i = 10
                    End If
                    arrNews2 = ctlNews2.TopFocusNews(0, 7)
                    Me.drgOtherNews.DataSource = arrNews2
                    Me.drgOtherNews.DataBind()
                End If
            Catch ex As Exception
                ProcessModuleLoadException(Me, ex)
            End Try
        End Sub
        Public Function FormatURL(ByVal sitem As String, ByVal strID As String, ByVal strLink As String) As String
            Return "/" & sitem & "/" & strID & "/" & ReplaceChuoi(strLink) & ".htm"
        End Function
        Public Function ImageHeight() As String
            Return IIf(Settings("NVNewsImageValueSetting") <> "", Split(Settings("NVNewsImageValueSetting"))(1), 60)
        End Function
        Public Function ReplaceChuoi(ByVal chuoi As String) As String
            Dim convert As String = Global.ReplaceChuoi.bodau(chuoi).Replace(" ", "-")
            Return convert
        End Function
#End Region

    End Class

End Namespace
